{extend name="apps/common/view/admin.tpl" /}
<!-- -->
{block name="header_meta"}
<title>{:lang("category_index")}－{:lang('appName')}</title>
{/block}
<!-- -->
{block name="main"}
<h6 class="border-bottom text-purple pb-2 mb-0">
  {:lang("category_index")}
</h6>
<form action="{:DcUrl('admin/category/delete', '', '')}" method="post" data-toggle="form">
<input type="hidden" name="_method" value="delete">
<div class="form-row collapse" id="filter-row">
  {:DcFormFilter($fields)}
</div>
<div class="toolbar" id="toolbar">
  <a class="btn btn-sm btn-light border" href="{:DcUrl('admin/category/create', $query, '')}" data-toggle="create" data-modal-xl="1">
    <i class="fa fa-plus"></i>
    {:lang('create')}
  </a>
  <button class="btn btn-sm btn-outline-danger" type="submit" data-toggle="delete">
    <i class="fa fa-trash"></i>
    {:lang('delete')}
  </button>
  <a class="btn btn-sm btn-light border" href="javascript:;" data-toggle="reload">
    <i class="fa fa-refresh"></i>
    {:lang('refresh')}
  </a>
  <a class="btn btn-sm btn-light border" href="#filter-row" data-toggle="collapse">
    <i class="fa fa-filter"></i>
    {:lang('filter')}
  </a>
</div>
{:DcBuildTable([
    'data-escape'             => false,
    'data-toggle'             => 'bootstrap-table',
    'data-url'                => DcUrl('admin/category/index', $query, ''),
    'data-url-sort'           => '',
    'data-url-preview'        => DcUrl('admin/category/preview', ['id'=>''], ''),
    'data-url-edit'           => DcUrl('admin/category/edit', ['id'=>''], ''),
    'data-url-delete'         => DcUrl('admin/category/delete', ['id'=>''], ''),
    'data-buttons-prefix'     => 'btn',
    'data-buttons-class'      => 'purple',
    'data-icon-size'          => 'sm',
    
    'data-toolbar'            => '.toolbar',
    'data-toolbar-align'      => 'none float-md-left',
    'data-buttons-align'      => 'right',
    'data-search-align'       => 'none float-md-right',
    'data-search'             => 'true',
    'data-show-search-button' => 'true',
    'data-show-refresh'       => 'true',
    'data-show-toggle'        => 'true',
    'data-show-fullscreen'    => 'true',
    'data-smart-display'      => 'false',
    
    'data-unique-id'          => 'term_id',
    'data-id-field'           => 'term_id',
    'data-select-item-name'   => 'id[]',
    'data-query-params-type'  => 'params',
    'data-query-params'       => 'daicuo.table.query',
    'data-sort-name'          => 'tree',
    'data-sort-order'         => 'desc',
    'data-sort-class'         => 'table-active',
    'data-sort-stable'        => 'true',
    
    'data-side-pagination'    => 'server',
    'data-total-field'        => 'total',
    'data-data-field'         => 'data',
    
    'data-pagination'         => true,
    'data-page-number'        => $page,
    'data-page-size'          => '30',
    'data-page-list'          => '[10, 25, 50, 100]',

    //'data-pagination-h-align'        => 'left',
    //'data-pagination-detail-h-align' => 'right',
    //'data-pagination-v-align'        => 'top',
    //'data-show-extended-pagination'  => 'true',
    
    'columns'                 => $columns,
])}
</form>
{/block}